﻿$(function () {
    $("#loginBtn").click(function () {
        var phone = $("#phone").val();
        var password = $("#password").val();
        if (phone === "") {
            layer.msg("请输入手机号码");
            return;
        }
        if (!/^\d{11}$/.test(phone)) {
            layer.msg("手机号码格式错误");
            return;
        }
        if (password === "") {
            layer.msg("请输入账号密码");
            return;
        }
        var autoLogin = $("#autoLogin").prop("checked");
        try {
            unifyResult({
                func: "login",
                success: function (res) {
                    objectJS.openForm({ "name": "app", "windowMax": true, "windowMin": false, "max": true, "min": true, "display": true, "title": "工蜂引流", "url": "\\\\page\\\\index.html", "width": 480, "height": 600, "minWidth": 1000, "minHeight": 600, "successFunc": "successFunc" });
                }
            }, phone, password, autoLogin);
        } catch (e) {
            alert(e);
        }
    });
});

function successFunc() {
    //关闭当前窗口
    objectJS.exit();
}